import { createApp } from "vue";
import App from "./App.vue";
import Hello from "./Hello.vue";

// 创建应用
const app = createApp(App);

// 全局组件使用
app.component("Hello", Hello);

// 全局属性
app.config.globalProperties.x = 100;
declare module "vue" {
  interface ComponentCustomProperties {
    x: number;
  }
}

// 自定义指令即 v-beauty
app.directive("beauty", (element, { value }) => {
  element.innerText += value;
  element.style.color = "skybluek";
  element.style.backgroundColor = "yellow";
});

// 挂载应用
app.mount("#app");
